package com.beiding.hotcode.v2;

public class ClassGroup {

    private MonitorGroup monitorGroup;

    ClassGroup(MyFactory myFactory) {
        monitorGroup = new MonitorGroup(myFactory);
    }

    public void addClass(MyClass myClass) {
        if (myClass instanceof HotClass) {
            monitorGroup.add(((HotClass) myClass).getJavaMonitor());
        }
    }

    public void removeClass(MyClass myClass) {
        if (myClass instanceof HotClass) {
            monitorGroup.remove(((HotClass) myClass).getJavaMonitor());
        }
    }

}
